﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AvansRS.Domain;
using FluentNHibernate.Mapping;
namespace AvansRS.Data.Mapping
{
    public class GroupMap : ClassMap<Group>
    {
        public GroupMap()
        {
            Id(x => x.ID);
            Map(x => x.Year);
				Map(x => x.Name);
            //Map(x => x.IsGroup);
            //HasOne(x => x.Leader);
            Map(x => x.GroupType).CustomType<GroupType>();
            References(x => x.Leader)
                .Not.LazyLoad();
            //HasManyToMany(x => x.Appointments).AsBag();
				HasManyToMany(x => x.Members)
					.Not.LazyLoad();
            References(x => x.Entity)
                .Not.LazyLoad();

        }
 
    }
}
